Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to push daily reminder notification everyday at 1… #3322

Closed
wants to merge 1 commit into from

Conversation

hariom982
Copy link

…2AM urging to fill in expenses ,transactions and incomes;

Pull request (PR) checklist

Please check if your pull request fulfills the following requirements:

  • The PR is submitted to the main branch.
  • I've read the Contribution Guidelines and my PR doesn't break the rules.
  • I've read and understand the Developer Guidelines.
  • I confirm that I've run the code locally and everything works as expected.
  • My PR includes only the necessary changes to fix the issue (i.e., no unnecessary files or lines of code are changed).
  • 🎬 I've attached a screen recording of using the new code to the next paragraph (if applicable).

Screen recording of interacting with your changes:

What's changed?

Describe with a few bullets what's new:

  • ...

  • ...

Risk factors

What may go wrong if we merge your PR?

  • ...
  • ...

In what cases won't your code work?

  • ...
  • ...

Does this PR close any GitHub issues?

  • Closes #{ISSUE_NUMBER}

Troubleshooting CI failures ❌

Pull request checks failing? Read our CI Troubleshooting guide.

…2AM urging to fill in expenses ,transactions and incomes;
Copy link
Collaborator

@ILIYANGERMANOV ILIYANGERMANOV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Fill the PR template
  2. Revert unnecessary changes
  3. Extract the reminders feature as a separate module
  4. Make the reminder a Setting that users can turn off

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this change

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these changes

}
//For pushing Notification to the user as a reminder at every 12AM
// urging to fill in expenses, transactions and incomes
fun createNotificationChannel(context: Context) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract this logic in a separate class and module that lives outside :app. For example, :feature:reminders

@@ -99,6 +99,10 @@ class RootActivity : AppCompatActivity(), RootScreen {
setupDatePicker()
setupTimePicker()

createNotificationChannel(this)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all users might want to have reminders, use IvyFeatures to make it a customizable setting that's enabled by default

@ILIYANGERMANOV ILIYANGERMANOV added the requested changes Changes are needed. Please, apply them label Jul 10, 2024
if (ActivityCompat.checkSelfPermission(
context,
Manifest.permission.POST_NOTIFICATIONS
) != PackageManager.PERMISSION_GRANTED
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code would simpler if:

  1. Extract the permission check as a hasNotificationsPermission function
  2. if (hasNotificationsPermisson()) notify


val builder = NotificationCompat.Builder(context, "DAILY_REMINDER_CHANNEL_ID")
.setSmallIcon(R.drawable.ic_launcher-playstore)
.setContentTitle("EveryDay Reminder")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract these a string so they can be localized

@ILIYANGERMANOV
Copy link
Collaborator

Overall, the implementation looks good and should work but please attach a screen recording testing it

val builder = NotificationCompat.Builder(context, "DAILY_REMINDER_CHANNEL_ID")
.setSmallIcon(R.drawable.ic_launcher-playstore)
.setContentTitle("EveryDay Reminder")
.setContentText("Fill in todays expences,transactions and incomes.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in expenses

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing @suyash01 🙌

@github-actions github-actions bot added Stale No activity, will be automatically closed soon. and removed Stale No activity, will be automatically closed soon. labels Jul 14, 2024
@github-actions github-actions bot closed this Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requested changes Changes are needed. Please, apply them Stale No activity, will be automatically closed soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants